From: Eli Zaretskii Date: Mon, 16 Feb 2004 11:42:10 +0000 (+0000) Subject: (rmail-dont-reply-to): Anchor user login X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~24108 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=3d96077b2f41475d7311f89a2908fac31aadb21a;p=emacs.git (rmail-dont-reply-to): Anchor user login name and email address at the beginning and end of the address. --- diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el index e60e8358de9..96a57b38f07 100644 --- a/lisp/mail/mail-utils.el +++ b/lisp/mail/mail-utils.el @@ -227,9 +227,15 @@ the comma-separated list. The pruned list is returned." "") (if (and user-mail-address (not (equal user-mail-address user-login-name))) - (concat (regexp-quote user-mail-address) "\\|") + ;; Anchor the login name and email address so + ;; that we don't match substrings: if the + ;; login name is "foo", we shouldn't match + ;; "barfoo@baz.com". + (concat "\\`" + (regexp-quote user-mail-address) + "\\'\\|") "") - (concat (regexp-quote user-login-name) "\\>")))) + (concat "\\`" (regexp-quote user-login-name) "@")))) ;; Split up DESTINATIONS and match each element separately. (let ((start-pos 0) (cur-pos 0) (case-fold-search t))